﻿// -----------------------------------------------------------------------
// <copyright file="PushParameters.cs" company="Zen Design Corp">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Zen.BlackBerry.Push
{
	using System;
	using System.Collections.Generic;
	using Zen.BlackBerry.Common;
	using Zen.BlackBerry.Push.AppManagement;

	/// <summary>
	/// Parameters that define the characteristics of a push message to send.
	/// </summary>
	[Serializable]
	public class PushParameters
	{
		private List<string> _addresses;

		/// <summary>
		/// Initializes a new instance of the <see cref="PushParameters"/> class.
		/// </summary>
		public PushParameters()
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="PushParameters"/> class.
		/// </summary>
		/// <param name="applicationId">The application id.</param>
		/// <param name="content">The content.</param>
		/// <param name="addresses">The addresses.</param>
		public PushParameters(string applicationId, Content content, params string[] addresses)
		{
			ApplicationId = applicationId;
			Content = content;
			Addresses.AddRange(addresses);
		}

		/// <summary>
		/// Gets or sets the application id.
		/// </summary>
		/// <value>The application id.</value>
		public string ApplicationId
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the content.
		/// </summary>
		/// <value>The content.</value>
		public Content Content
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the addresses.
		/// </summary>
		/// <value>The addresses.</value>
		public List<string> Addresses
		{
			get
			{
				if (_addresses == null)
				{
					_addresses = new List<string>();
				}
				return _addresses;
			}
			set
			{
				_addresses = value;
			}
		}

		/// <summary>
		/// Gets or sets the push id.
		/// </summary>
		/// <value>The push id.</value>
		public string PushId
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the is application reliable.
		/// </summary>
		/// <value>The is application reliable.</value>
		public bool? IsApplicationReliable
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the deliver before date.
		/// </summary>
		/// <value>The deliver before date.</value>
		public DateTime? DeliverBeforeDate
		{
			get;
			set;
		}

		/// <summary>
		/// Validates that mandatory parameters are set for specified
		/// application type.
		/// </summary>
		/// <param name="applicationType">Type of the application.</param>
		public void Validate(PushApplicationType applicationType)
		{

		}
	}
}
